package com.dyb.recuitment.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户日志表
 * </p>
 *
 * @author 邓宇斌
 * @since 2022-02-21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class UserLog extends Model {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 操作类型
     */
    private String operate;

    /**
     * 操作key
     */
    private String logKey;

    /**
     * 操作value
     */
    private String logValue;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    /**
     * 数据状态（1：正常，0：禁用，-1：删除）
     */
    private Integer status;

    public UserLog(Integer userId, String operate) {
        this.userId = userId;
        this.operate = operate;
    }

    public UserLog(Integer userId, String operate, String logKey) {
        this.userId = userId;
        this.operate = operate;
        this.logKey = logKey;
    }

    public UserLog(Integer userId, String operate, String logKey, String logValue) {
        this.userId = userId;
        this.operate = operate;
        this.logKey = logKey;
        this.logValue = logValue;
    }
}
